/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import model.AgendaDAO;
import model.CompromissoDAO;
import model.PacienteDAO;
import model.ProfissionalDAO;

/**
 *
 * @author Eduarda
 */
public class TratapreCadastroAgenda  extends Comando{

    @Override
    public void executar(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, IOException, ServletException {
        
         response.setContentType("text/html;charset=UTF-8");

        AgendaDAO agendao = new AgendaDAO();
        ProfissionalDAO pacdao = new ProfissionalDAO();
        HttpSession session = request.getSession(false);
        session.setAttribute("listaAgendas", agendao.pesquisar());
        session.setAttribute("listaProfissionais", pacdao.pesquisar());
       // session.setAttribute("listaPacientes", new ArrayList());        
        response.sendRedirect("cadastraAgenda.jsp");
    }
    
}
